#include "StdAfx.h"

#include <string>
#include <iostream>
#include <sstream>

#include "StringFunctions.h"

std::string CComBSTRtoString(CComBSTR in)
{
		try
		{
			std::wstring ws(in);
			std::string s(ws.begin(), ws.end());
			s.assign(ws.begin(), ws.end());
			return s;
		}
			catch (...)
		{

		}
		std::string s = "";
		return s;
}

HRESULT StringtoCComBSTR(std::string in, CComBSTR* out)
{
	std::wstring ws(in.begin(), in.end());
	ws.assign(in.begin(), in.end());
	ws.copy(*out,ws.length());

	return S_OK;
}

std::string InttoString(int in)
{
	std::string s;
	std::stringstream out;
	out << in;
	s = out.str();
	return s;
}